package com.origin.ebuy.forg.web.controller.user;

import com.origin.ebuy.bargd.service.order.IOrderService;
import com.origin.ebuy.bargd.service.order.impl.OrderServiceImpl;
import com.origin.ebuy.forg.web.BaseServlet;
import java.io.IOException;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class OrderUpdateServlet
 */
public class OrderUpdateServlet extends BaseServlet {
	private static final long serialVersionUID = 1L;

    /**
     * Default constructor. 
     */
    public OrderUpdateServlet() {
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		super.doPost(request, response);
		//订单id
		String id = request.getParameter("id");
		String state = request.getParameter("state");
		IOrderService service = new OrderServiceImpl();
		try {
			service.updateOrderState(id, state);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}

}
